package com.utils.fetch;
/*
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class FetchStartThread {
	
	@Autowired
	FetchFictionContent fetchFictionContent;
	
	@Autowired
	FetchFictionContent2 fetchFictionContent2;
	
	@Autowired
	FetchFictionContent3 fetchFictionContent3;
	
	public void startFetch(String[] sourceList,short sex,String tag,int breakpoint,long parentId,int speed) {

		   for (int i = 0; i < sourceList.length; i++) {
			   FetchThread ft = new FetchThread(sourceList[i], sex, tag, breakpoint, parentId, speed);
			   ft.setName("资源ID:"+sourceList[i]);
			   ft.start();
		   }
	}
	
	public void startFetch2(String rank, int spage, int epage) {
		   Fetch2Thread ft = new Fetch2Thread(rank, spage, epage);
		   ft.setName("资源ID:"+rank+"["+spage+","+epage+")");
		   ft.start();
	}
	
	public void startFetch2One(int id, String title) {
		   Fetch2OneThread ft = new Fetch2OneThread(id, title);
		   ft.setName("资源ID:"+"["+id+","+title+"]");
		   ft.start();
	}
	
	public void startFetch2List(String list, int spage, int epage) {
		   Fetch2ListThread ft = new Fetch2ListThread(list, spage, epage);
		   ft.setName("资源ID:"+list+"["+spage+","+epage+")");
		   ft.start();
	}
	
	
	public void startFetch2Update() {
		   Fetch2UpdateThread ft = new Fetch2UpdateThread();
		   ft.setName("资源ID-Update");
		   ft.start();
	}
	
	
	public void startFetch3One(int idnum, int id, String title) {
		   Fetch3OneThread ft = new Fetch3OneThread(idnum, id, title);
		   ft.setName("资源ID:"+"["+idnum+"/"+id+","+title+"]");
		   ft.start();
	}
	
	public void startFetch3List(String list, int spage, int epage) {
		   Fetch3ListThread ft = new Fetch3ListThread(list, spage, epage);
		   ft.setName("资源ID:"+list+"["+spage+","+epage+")");
		   ft.start();
	}
	

	private class FetchThread extends Thread {
		
		private int sourceId;
		private short sex;
		private String tag;
		private int breakpoint;
		private long parentId;
		private int speed;
		
		public FetchThread(String sourceId,short sex,String tag,int breakpoint,long parentId,int speed) {
			this.sourceId = Integer.parseInt(sourceId);
			this.sex = sex;
			this.tag = tag;
			this.breakpoint = breakpoint;
			this.parentId = parentId;
			this.speed = speed;
		}
		
		@Override
		public void run() {
			 System.out.println("sourceId:"+sourceId+",sex:"+sex+",tag:"+tag+",breakpoint:"+breakpoint+",parentId:"+parentId+",speed:"+speed);
	//		 FrameSpringBeanUtil.getBean(FetchFictionContent.class).fetchFiction(sourceId,sex,tag,breakpoint,parentId,speed); 
			 fetchFictionContent.fetchFiction(sourceId,sex,tag,breakpoint,parentId,speed); 
		}
	
	}
	
	private class Fetch2Thread extends Thread {
		
		private String rank;
		private int spage;
		private int epage;
		
		public Fetch2Thread(String rank, int spage, int epage) {
			this.rank = rank;
			this.spage = spage;
			this.epage = epage;
		}
		
		@Override
		public void run() {
			 fetchFictionContent2.fetchFiction(true, rank,spage, epage); 
		}
	}
	
	private class Fetch2OneThread extends Thread {
		
		private int id;
		private String title;
		
		public Fetch2OneThread(int id, String title) {
			this.id = id;
			this.title = title;
		}
		
		@Override
		public void run() {
			 fetchFictionContent2.fetchFictionOne(true, id, title); 
		}
	}
	
	private class Fetch2ListThread extends Thread {
		
		private String list;
		private int spage;
		private int epage;
		
		public Fetch2ListThread(String list, int spage, int epage) {
			this.list = list;
			this.spage = spage;
			this.epage = epage;
		}
		
		@Override
		public void run() {
			 fetchFictionContent2.fetchFictionList(true, list,spage, epage); 
		}
	}
	
	private class Fetch2UpdateThread extends Thread{
		
		public Fetch2UpdateThread(){
			
		}
		@Override
		public void run() {
			 fetchFictionContent2.fetchFictionUpdate(true); 
		}
	}
	
	
	private class Fetch3OneThread extends Thread {
		
		private int idnum;
		private int id;
		private String title;
		
		public Fetch3OneThread(int idnum, int id, String title) {
			this.idnum = idnum;
			this.id = id;
			this.title = title;
		}
		
		@Override
		public void run() {
			 fetchFictionContent3.fetchFictionOne(true, idnum, id, title); 
		}
	}
	
	private class Fetch3ListThread extends Thread {
		
		private String list;
		private int spage;
		private int epage;
		
		public Fetch3ListThread(String list, int spage, int epage) {
			this.list = list;
			this.spage = spage;
			this.epage = epage;
		}
		
		@Override
		public void run() {
			 fetchFictionContent3.fetchFictionList(true, list,spage, epage); 
		}
	}
}*/